package com.example.springpostbody.core.listener;

import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.annotation.WebListener;

//@WebListener
public class AppStartupListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        // 应用启动时执行的初始化逻辑
        System.out.println("应用开始启动");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        // 应用关闭时执行的清理逻辑
        System.out.println("应用开始关闭");
    }
}
